package logic

import (
	"context"
	"shop_srv/cathe"

	"shop_srv/internal/svc"
	"shop_srv/shop"

	"github.com/zeromicro/go-zero/core/logx"
)

type DeleterGoodsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDeleterGoodsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleterGoodsLogic {
	return &DeleterGoodsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DeleterGoodsLogic) DeleterGoods(in *shop.DeleterGoodsRequest) (*shop.DeleterGoodsResponse, error) {
	err := cathe.DeleterGoods(int(in.UserId), int(in.GoodsId))
	if err != nil {
		return nil, err
	}

	return &shop.DeleterGoodsResponse{}, nil
}
